﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using X23.Model;

namespace X23.EFCore.Mapping
{

    public class Mapping<T> : IEntityTypeConfiguration<T> where T : BaseAuditedEntity
    {
        public void Configure(EntityTypeBuilder<T> builder)
        {
            builder.Property(x => x.Remark).HasMaxLength(500);
            builder.Property(x => x.CreateBy).HasMaxLength(20);
            builder.Property(x => x.UpdateBy).HasMaxLength(20);
            OtherConfigure(builder);
        }

        public virtual void OtherConfigure(EntityTypeBuilder<T> builder)
        {

        }
    }
}
